package a.j;

import a.b.b;
import a.b.d;
import a.c.y;

import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;

public class oc
  implements b
{
  private i a;
  private List b;
  private List c;
  private Rectangle2D.Double d;
  private boolean e;
  private final pg f;
  public static boolean g;
  
  public oc(pg parampg)
  {
    this.f = parampg;
    this.d = null;
    this.e = false;
    this.a = new i();
    this.b = new ArrayList();
    this.c = new ArrayList();
  }
  
  public pg a()
  {
    return this.f;
  }
  
  public void a(qb paramqb)
  {
    if (paramqb == null) {
      return;
    }
    this.a.add(paramqb);
  }
  
  public void b(qb paramqb)
  {
    if (paramqb == null) {
      return;
    }
    this.a.remove(paramqb);
  }
  
  public void a(tb paramtb)
  {
    if (paramtb == null) {
      return;
    }
    this.c.add(paramtb);
  }
  
  public void b(tb paramtb)
  {
    if (paramtb == null) {
      return;
    }
    this.c.remove(paramtb);
  }
  
  public void a(ld paramld)
  {
    if (paramld == null) {
      return;
    }
    this.b.add(paramld);
  }
  
  public void b(ld paramld)
  {
    if (paramld == null) {
      return;
    }
    this.b.remove(paramld);
  }
  
  public void b()
  {
    this.b.clear();
    this.c.clear();
    this.a.clear();
  }
  
  public void a(a.b.k paramk)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    if (!bool3) {}
    switch (paramk.a())
    {
    case 0: 
      Object localObject = paramk.getSource();
      if (((bool3) || ((localObject instanceof d))) && ((bool3) || (((d)localObject).d()))) {
        if (bool3) {}
      }
      int i = ((d)localObject).c() ? 1 : 0;
      boolean bool1 = this.f.C().I();
      if (!bool3)
      {
        if (i != 0) {
          this.f.C().f(true);
        }
        e();
      }
      if (!bool3)
      {
        if (i != 0) {
          this.f.C().f(bool1);
        }
      }
      else if (!bool3) {
        if (!bool2) {
          return;
        }
      }
      break;
    case 3: 
      if (!bool3)
      {
        c();
        if (!bool2) {
          return;
        }
      }
    case 4: 
      c();
    }
  }
  
  public void c()
  {
    this.d = null;
  }
  
  public void d()
  {
    this.f.b();
  }
  
  public void e()
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.e)
      {
        this.f.b();
        c();
        return;
      }
    }
    if (!bool) {
      if (this.d == null)
      {
        g();
        if (bool) {
          break label61;
        }
        this.f.b();
        if (!ld.D) {
          return;
        }
      }
    }
    label61:
    Rectangle2D.Double localDouble = g();
    if ((bool) || ((localDouble.width > 0.0D) && (localDouble.height > 0.0D))) {
      this.f.a(localDouble.x, localDouble.y, localDouble.width, localDouble.height);
    }
  }
  
  public boolean f()
  {
    return this.e;
  }
  
  public void a(boolean paramBoolean)
  {
    this.e = paramBoolean;
    c();
  }
  
  private Rectangle2D.Double g()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = this.f.f(0);
    double d2 = this.f.g(0);
    Rectangle2D.Double localDouble1 = new Rectangle2D.Double(d1, d2, this.f.f(this.f.getWidth()) - d1, this.f.g(this.f.getHeight()) - d2);
    Rectangle2D.Double localDouble2 = new Rectangle2D.Double();
    Rectangle2D.Double localDouble3 = new Rectangle2D.Double();
    localDouble3.setRect(0.0D, 0.0D, -1.0D, -1.0D);
    y localy = this.a.h();
    if (localy.e())
    {
      localDouble2.setRect(0.0D, 0.0D, -1.0D, -1.0D);
      a((qb)localy.j(), localDouble2);
    }
    while (bool2)
    {
      if (bool1) {
        break label193;
      }
      if (localDouble1.intersects(localDouble2)) {
        a.d.k.a(localDouble3, localDouble2, localDouble3);
      }
      localy.f();
      if (!bool1) {
        break;
      }
    }
    label193:
    int i = 0;
    int j = this.b.size();
    if (i < j) {}
    Object localObject;
    do
    {
      localObject = (ld)this.b.get(i);
      localDouble2.setRect(0.0D, 0.0D, -1.0D, -1.0D);
      a((ld)localObject, localDouble2);
      if (bool1) {
        break label300;
      }
      if (localDouble1.intersects(localDouble2)) {
        a.d.k.a(localDouble3, localDouble2, localDouble3);
      }
      i++;
      if (!bool1) {
        break;
      }
      i = 0;
    } while (bool2);
    label300:
    j = this.c.size();
    if (i < j) {}
    while (bool2)
    {
      localObject = (tb)this.c.get(i);
      localDouble2.setRect(0.0D, 0.0D, -1.0D, -1.0D);
      a((tb)localObject, localDouble2);
      if (bool1) {
        break label431;
      }
      if (localDouble1.intersects(localDouble2)) {
        a.d.k.a(localDouble3, localDouble2, localDouble3);
      }
      i++;
      if (!bool1) {
        break;
      }
    }
    if (!bool2)
    {
      if (this.d == null) {
        this.d = localDouble1;
      }
      a.d.k.a(this.d, localDouble3, localDouble2);
      a.d.k.b(localDouble1, localDouble2, localDouble2);
    }
    if (localDouble2.width >= 0.0D)
    {
      label431:
      if (bool2) {
        break label509;
      }
      if (localDouble2.height >= 0.0D)
      {
        localDouble2.x -= 10.0D;
        localDouble2.y -= 10.0D;
        localDouble2.width += 20.0D;
        localDouble2.height += 20.0D;
      }
    }
    this.d = localDouble3;
    label509:
    return localDouble2;
  }
  
  protected void a(qb paramqb, Rectangle2D paramRectangle2D)
  {
    a.d.k.a(paramqb.getBounds(), paramRectangle2D, paramRectangle2D);
  }
  
  protected void a(tb paramtb, Rectangle2D paramRectangle2D)
  {
    paramtb.a(paramRectangle2D);
  }
  
  protected void a(ld paramld, Rectangle2D paramRectangle2D)
  {
    paramld.b(paramRectangle2D);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.oc

 * JD-Core Version:    0.7.0.1

 */